<template>
  <BasicCard>
    <BasicVxeTable v-bind="gridOptions"> </BasicVxeTable>
  </BasicCard>
</template>

<script setup lang="ts">
  import { columnsCount } from '../data'
  import { getPanCun } from '@/api/wms'

  const { t } = useI18n()

  const gridOptions = reactive<BasicGridProps>({
    extraConfig: {
      title: t('custom.库存盘点'),
      isCustom: false,
      isExport: false,
      isFilterAndSort: true
    }, // 拓展的配置
    id: `kucunguanli-chengpinguanli-kucunpandian`, // id用于缓存,务必配置
    maxHeight: '100%',
    loading: true,
    columns: columnsCount,
    toolbarConfig: {} // 工具栏
  })

  const getList = () => {
    getPanCun()
      .then((res: any) => {
        gridOptions.loading = false
        gridOptions.data = res.inventory
      })
      .catch(() => {
        gridOptions.loading = false
      })
  }

  onMounted(() => {
    getList()
  })
</script>
